package cn.edu.nchu.comic_strip.database;

import androidx.room.TypeConverter;

import java.util.Date;

/**
 * @className: Converters
 * @description: TODO 类描述
 * @author: Kuangkeli
 * @date: 2024/05/24 16:25
 **/
public class Converters {
    @TypeConverter
    public static Date fromTimestamp(Long value) {
        return value == null ? null : new Date(value);
    }
    @TypeConverter
    public static Long dateToTimestamp(Date date) {
        return date == null ? null : date.getTime();
    }
}
